package com.example.thornchg.yc_plane_game;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

import java.util.ArrayList;

public class DBHandle {
    public ArrayList<String> getHistoryScoreList(SQLiteDatabase db){
        ArrayList<String> datas=new ArrayList<>();
        Cursor cursor=db.rawQuery("select * from history_score_tb order by score desc limit 10",null);
        while (cursor.moveToNext()){
            datas.add(cursor.getInt(1)+"");
        }
        cursor.close();
        return datas;
    }
    public void insert(SQLiteDatabase db,int score){
        db.execSQL("insert into history_score_tb(score) values("+score+")");
    }
}
